<template>
  <div>
    <!-- 列表组件 -->
    <el-table :data="memberList" border style="width: 100%" default-expand-all>
      <el-table-column prop="id" label="用户编号" width="180">
      </el-table-column>
      <el-table-column prop="nickname" label="昵称" width="180">
      </el-table-column>
      <el-table-column prop="phone" label="手机号" width="180">
      </el-table-column>
      <el-table-column label="状态">
        <template slot-scope="item">
          <div>
            <el-tag v-if="item.row.status == 1" type="success">启用</el-tag>
            <el-tag type="danger" v-else>禁用</el-tag>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="item">
          <div>
            <el-button class="btnInfo" type="primary" icon="el-icon-edit" circle @click="edit(item.row.uid)">
            </el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
//引入辅助性函数
import { mapGetters, mapActions } from "vuex";
export default {
  computed: {
    ...mapGetters({
      memberList: "member/getMemberList"
    })
  },
  mounted() {
    // 获取轮播图列表
    this.getMemberList()
  },
  methods: {
    ...mapActions({
      getMemberList: "member/getMemberList_Action"
    }),
    //点击编辑
    edit(uid) {
      this.$emit("edit", uid);
    },
  },
};
</script>


<style scoped>
.imgUrl {
  width: 100px;
  height: 100px;
}
</style>
